﻿@model GitCandy.Models.TreeEntryModel

@{
    ViewBag.Title = string.Format(SR.Shared_TitleFormat, string.Format(SR.Repository_BlobTitle, Model.RepositoryName, Model.ReferenceName ?? Model.Sha.ToShortSha(), Model.Path));
}

<h4>@Html.ActionLink(Model.RepositoryName, "Tree", Html.OverRoute(new { path = "" }))</h4>

@Html.Partial("_PathBar", Model.PathBar)
@Html.Partial("_BranchSelector", Model.BranchSelector)

<pre>@Model.Commit.CommitMessageShort</pre>
<div class="row">
    <div class="col-md-12">
        <strong title="@Model.Commit.Author">@Model.Commit.Author.Name</strong>
        <span>@SR.Repository_AuthoredAt</span>
        <span title="@Model.Commit.Author.When">@Model.Commit.Author.When.LocalDateTime</span>
        @if (Model.Commit.Author != Model.Commit.Committer)
        {
            <strong title="@Model.Commit.Committer">@Model.Commit.Committer.Name</strong>
            <span>@SR.Repository_CommittedAt</span>
            <span title="@Model.Commit.Committer.When">@Model.Commit.Committer.When.LocalDateTime</span>
        }
    </div>
</div>
<div class="row">
    <div class="col-md-12">
        <span>@Model.SizeString</span>
        <div class="pull-right">
            @Html.ActionLink(SR.Repository_History, "Commits", Html.OverRoute(new { path = (Model.ReferenceName ?? Model.Sha) + "/" + Model.Path }), new { @class = "btn btn-default" })
            @Html.ActionLink(SR.Repository_Blame, "Blame", Html.OverRoute(new { path = (Model.ReferenceName ?? Model.Sha) + "/" + Model.Path }), new { @class = "btn btn-default hidden-xs" })
            @Html.ActionLink(SR.Repository_Raw, "Raw", Html.OverRoute(new { path = (Model.ReferenceName ?? Model.Sha) + "/" + Model.Path }), new { @class = "btn btn-default" })
        </div>
    </div>
</div>
<div class="border-area">
    <table class="table">
        <caption>
            <div class="pull-left keep-space"><i class="glyphicon glyphicon-list-alt"></i>@Model.Name</div>
        </caption>
        <tbody>
            <tr>
                <td>
                    @Html.Partial("_BlobPreview")
                </td>
            </tr>
        </tbody>
    </table>
</div>
